package com.joysuch.wwyt.list.bean;

import lombok.Data;

import java.io.Serializable;
import java.util.List;

@Data
public class BpListTypeTreeBean implements Serializable , Comparable<BpListTypeTreeBean> {

    private Long id;

    private String label;

    private Integer showOrder;

    private List<BpListTypeTreeBean> children;

    @Override
    public int compareTo(BpListTypeTreeBean t) {
        if (this.getShowOrder() == null && t.getShowOrder() == null) {
            return 0;
        } else if (this.getShowOrder() == null) {
            return -1;
        } else if (t.getShowOrder() == null) {
            return 1;
        } else {
            return this.getShowOrder() - t.getShowOrder();
        }
    }
}



